﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_TinhChiPhiBanHang : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvDoiTuong")]
        private ADVObjects _AdvDoiTuong;
        [AccessedThroughProperty("AdvTKCo")]
        private ADVAccount _AdvTKCo;
        [AccessedThroughProperty("AdvTKNo")]
        private ADVAccount _AdvTKNo;
        [AccessedThroughProperty("CboLoaiDuLieu")]
        private ComboBox _CboLoaiDuLieu;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdChuyen")]
        private Button _CmdChuyen;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdFind")]
        private ToolStripButton _CmdFind;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripButton _CmdPrint;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("CmdTimHoaDon")]
        private Button _CmdTimHoaDon;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("ImageList1")]
        private ImageList _ImageList1;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label12")]
        private Label _Label12;
        [AccessedThroughProperty("Label14")]
        private Label _Label14;
        [AccessedThroughProperty("Label15")]
        private Label _Label15;
        [AccessedThroughProperty("Label17")]
        private Label _Label17;
        [AccessedThroughProperty("Label18")]
        private Label _Label18;
        [AccessedThroughProperty("Label19")]
        private Label _Label19;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label20")]
        private Label _Label20;
        [AccessedThroughProperty("Label24")]
        private Label _Label24;
        [AccessedThroughProperty("Label25")]
        private Label _Label25;
        [AccessedThroughProperty("Label26")]
        private Label _Label26;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("PNDungChung")]
        private Panel _PNDungChung;
        [AccessedThroughProperty("TabControl1")]
        private TabControl _TabControl1;
        [AccessedThroughProperty("TabControl2")]
        private TabControl _TabControl2;
        [AccessedThroughProperty("TabPage1")]
        private TabPage _TabPage1;
        [AccessedThroughProperty("TabPage2")]
        private TabPage _TabPage2;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripButton2")]
        private ToolStripButton _ToolStripButton2;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("TxtDienGiai")]
        private TextBox _TxtDienGiai;
        [AccessedThroughProperty("TxtNgayChungTu")]
        private DateTimePicker _TxtNgayChungTu;
        [AccessedThroughProperty("TxtNgayHoaDon")]
        private DateTimePicker _TxtNgayHoaDon;
        [AccessedThroughProperty("TxtSoChungTu")]
        private TextBox _TxtSoChungTu;
        [AccessedThroughProperty("TxtSoHoaDon")]
        private TextBox _TxtSoHoaDon;
        [AccessedThroughProperty("TxtTienPhi")]
        private C1NumericEdit _TxtTienPhi;
        [AccessedThroughProperty("TxtTienPhiNT")]
        private C1NumericEdit _TxtTienPhiNT;
        [AccessedThroughProperty("TxtTyGia")]
        private C1NumericEdit _TxtTyGia;
        [AccessedThroughProperty("VSHangHoa")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSHangHoa;
        private string cFrmFormat;
        public string cFrmKhoa;
        public string cFrmKhoaHoaDon;
        private string cFrmKhoaOld;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnabledControl;
        private string mLoaiChungTu;
        private clsChiPhiBanHang objCP;
        private clsHoaHongChiTiet objCPCT;
        private clsXuatKho objHD;
        private clsDMLoaiTien objLT;
        private clsSoChungTu objSoCT;

        public Frm_TinhChiPhiBanHang()
        {
            base.Load += new EventHandler(this.Frm_TinhChiPhiBanHang_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.cFrmKhoaHoaDon = "";
            this.mLoaiChungTu = "HHBH";
            this.objSoCT = new clsSoChungTu();
            this.objHD = new clsXuatKho();
            this.objCP = new clsChiPhiBanHang();
            this.objLT = new clsDMLoaiTien();
            this.objCPCT = new clsHoaHongChiTiet();
            this.InitializeComponent();
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.EmptyData();
            this.objCP.ClearAll();
            this.cFrmKhoa = modGeneral.CreatKey("BH_ChiPhiBanHang", 15, "HH");
            this.objSoCT.Load(this.mLoaiChungTu);
            this.TxtSoChungTu.Text = this.objSoCT.CreateVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), 1);
            this.EnabledControl = true;
            this.TxtSoChungTu.Focus();
            this.AdvDoiTuong.Value = this.objHD.KhoaDoiTuong;
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdTimHoaDon_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_XuatBanList.Dispose();
            MyProject.Forms.Frm_XuatBanList.objFrmCall = this;
            MyProject.Forms.Frm_XuatBanList.ShowDialog();
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoaOld, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.cFrmKhoa = this.cFrmKhoaOld;
                this.ShowData(this.cFrmKhoa);
            }
            else
            {
                this.EmptyData();
            }
            this.EnabledControl = false;
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        public void EmptyData()
        {
            this.AdvDoiTuong.Value = "";
            this.AdvTKNo.Value = "";
            this.AdvTKCo.Value = "";
            this.TxtSoChungTu.Text = "";
            this.TxtDienGiai.Text = "";
            this.TxtNgayChungTu.Text = Strings.Format(DateAndTime.Today, "dd/MM/yyyy");
            this.VSHangHoa.Rows.Count = 1;
            this.TxtTienPhiNT.Value = 0;
            this.TxtTienPhi.Value = 0;
            this.TxtSoHoaDon.Text = "";
            this.TxtSoHoaDon.Tag = "";
        }

        public void FormatNumber()
        {
            LVYModule.advFormatNumber(this.TxtTienPhiNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienPhi, modGeneral.H_FORMATNUMBER);
            C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
            vSHangHoa.Cols[14].Format = this.cFrmFormat;
            vSHangHoa.Cols[15].Format = this.cFrmFormat;
            vSHangHoa.Cols[0x11].Format = this.cFrmFormat;
            vSHangHoa.Cols[0x12].Format = this.cFrmFormat;
            vSHangHoa = null;
        }

        private void Frm_TinhChiPhiBanHang_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.cFrmFormat = modGeneral.H_FORMATNUMBER;
                BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
                if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                {
                    this.ShowData(this.cFrmKhoa);
                }
                this.EnabledControl = false;
                this.FormatNumber();
                this.Cursor = Cursors.Default;
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_TinhChiPhiBanHang));
            this.ToolStrip1 = new ToolStrip();
            this.CmdAdd = new ToolStripButton();
            this.CmdEdit = new ToolStripButton();
            this.ToolStripSeparator2 = new ToolStripSeparator();
            this.CmdSave = new ToolStripButton();
            this.CmdUnsave = new ToolStripButton();
            this.ToolStripSeparator1 = new ToolStripSeparator();
            this.CmdFind = new ToolStripButton();
            this.CmdPrint = new ToolStripButton();
            this.ToolStripButton1 = new ToolStripSeparator();
            this.CmdDel = new ToolStripButton();
            this.CmdExit = new ToolStripButton();
            this.ToolStripButton2 = new ToolStripButton();
            this.Panel1 = new Panel();
            this.TxtTienPhiNT = new C1NumericEdit();
            this.TxtTienPhi = new C1NumericEdit();
            this.Label2 = new Label();
            this.TxtDienGiai = new TextBox();
            this.Label24 = new Label();
            this.Label25 = new Label();
            this.CmdChuyen = new Button();
            this.PNDungChung = new Panel();
            this.CboLoaiDuLieu = new ComboBox();
            this.Label26 = new Label();
            this.TabPage1 = new TabPage();
            this.Label1 = new Label();
            this.Label20 = new Label();
            this.Label12 = new Label();
            this.TxtNgayChungTu = new DateTimePicker();
            this.Label19 = new Label();
            this.TxtSoChungTu = new TextBox();
            this.CmdTimHoaDon = new Button();
            this.CboLoaiTien = new ComboBox();
            this.TxtTyGia = new C1NumericEdit();
            this.Label14 = new Label();
            this.Label15 = new Label();
            this.Label17 = new Label();
            this.TxtNgayHoaDon = new DateTimePicker();
            this.Label18 = new Label();
            this.TxtSoHoaDon = new TextBox();
            this.TabPage2 = new TabPage();
            this.VSHangHoa = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.ImageList1 = new ImageList(this.components);
            this.TabControl1 = new TabControl();
            this.TabControl2 = new TabControl();
            this.AdvTKNo = new ADVAccount();
            this.AdvTKCo = new ADVAccount();
            this.AdvDoiTuong = new ADVObjects();
            this.ToolStrip1.SuspendLayout();
            ((ISupportInitialize) this.TxtTienPhiNT).BeginInit();
            ((ISupportInitialize) this.TxtTienPhi).BeginInit();
            this.PNDungChung.SuspendLayout();
            this.TabPage1.SuspendLayout();
            ((ISupportInitialize) this.TxtTyGia).BeginInit();
            this.TabPage2.SuspendLayout();
            this.VSHangHoa.BeginInit();
            this.TabControl1.SuspendLayout();
            this.TabControl2.SuspendLayout();
            this.SuspendLayout();
            this.ToolStrip1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgbluenoborder;
            this.ToolStrip1.Items.AddRange(new ToolStripItem[] { this.CmdAdd, this.CmdEdit, this.ToolStripSeparator2, this.CmdSave, this.CmdUnsave, this.ToolStripSeparator1, this.CmdFind, this.CmdPrint, this.ToolStripButton1, this.CmdDel, this.CmdExit, this.ToolStripButton2 });
            Point point = new Point(0, 0);
            this.ToolStrip1.Location = point;
            this.ToolStrip1.Name = "ToolStrip1";
            Size size = new Size(0x37e, 0x19);
            this.ToolStrip1.Size = size;
            this.ToolStrip1.TabIndex = 0x9a;
            this.ToolStrip1.Text = "ToolStrip1";
            this.CmdAdd.Image = (Image) manager.GetObject("CmdAdd.Image");
            this.CmdAdd.ImageTransparentColor = Color.White;
            this.CmdAdd.Name = "CmdAdd";
            size = new Size(0x48, 0x16);
            this.CmdAdd.Size = size;
            this.CmdAdd.Text = "&Th\x00eam mới";
            this.CmdEdit.Image = (Image) manager.GetObject("CmdEdit.Image");
            this.CmdEdit.ImageTransparentColor = Color.White;
            this.CmdEdit.Name = "CmdEdit";
            size = new Size(0x2e, 0x16);
            this.CmdEdit.Size = size;
            this.CmdEdit.Text = "&Sửa";
            this.ToolStripSeparator2.Name = "ToolStripSeparator2";
            size = new Size(6, 0x19);
            this.ToolStripSeparator2.Size = size;
            this.CmdSave.Image = (Image) manager.GetObject("CmdSave.Image");
            this.CmdSave.ImageTransparentColor = Color.WhiteSmoke;
            this.CmdSave.Name = "CmdSave";
            size = new Size(0x2d, 0x16);
            this.CmdSave.Size = size;
            this.CmdSave.Text = "&Lưu";
            this.CmdUnsave.Image = (Image) manager.GetObject("CmdUnsave.Image");
            this.CmdUnsave.ImageTransparentColor = Color.White;
            this.CmdUnsave.Name = "CmdUnsave";
            size = new Size(0x37, 0x16);
            this.CmdUnsave.Size = size;
            this.CmdUnsave.Text = "&K.Lưu";
            this.ToolStripSeparator1.Name = "ToolStripSeparator1";
            size = new Size(6, 0x19);
            this.ToolStripSeparator1.Size = size;
            this.CmdFind.Image = (Image) manager.GetObject("CmdFind.Image");
            this.CmdFind.ImageTransparentColor = Color.White;
            this.CmdFind.Name = "CmdFind";
            size = new Size(0x43, 0x16);
            this.CmdFind.Size = size;
            this.CmdFind.Text = "T\x00ecm kiếm";
            this.CmdPrint.Image = (Image) manager.GetObject("CmdPrint.Image");
            this.CmdPrint.ImageTransparentColor = Color.White;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x25, 0x16);
            this.CmdPrint.Size = size;
            this.CmdPrint.Text = "&In";
            this.ToolStripButton1.Name = "ToolStripButton1";
            size = new Size(6, 0x19);
            this.ToolStripButton1.Size = size;
            this.CmdDel.Image = (Image) manager.GetObject("CmdDel.Image");
            this.CmdDel.ImageTransparentColor = Color.White;
            this.CmdDel.Name = "CmdDel";
            size = new Size(0x2d, 0x16);
            this.CmdDel.Size = size;
            this.CmdDel.Text = "&X\x00f3a";
            this.CmdExit.Alignment = ToolStripItemAlignment.Right;
            this.CmdExit.Image = (Image) manager.GetObject("CmdExit.Image");
            this.CmdExit.ImageTransparentColor = Color.White;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x37, 0x16);
            this.CmdExit.Size = size;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.ToolStripButton2.Alignment = ToolStripItemAlignment.Right;
            this.ToolStripButton2.Image = (Image) manager.GetObject("ToolStripButton2.Image");
            this.ToolStripButton2.ImageScaling = ToolStripItemImageScaling.None;
            this.ToolStripButton2.ImageTransparentColor = Color.White;
            this.ToolStripButton2.Name = "ToolStripButton2";
            size = new Size(0x31, 0x16);
            this.ToolStripButton2.Size = size;
            this.ToolStripButton2.Text = "&Help";
            this.Panel1.Dock = DockStyle.Bottom;
            point = new Point(0, 550);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            size = new Size(0x37e, 0x19);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x9d;
            this.TxtTienPhiNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienPhiNT.DataType = typeof(double);
            this.TxtTienPhiNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x202, 0x54);
            this.TxtTienPhiNT.Location = point;
            this.TxtTienPhiNT.Name = "TxtTienPhiNT";
            Padding padding = new Padding(1);
            this.TxtTienPhiNT.Padding = padding;
            size = new Size(0x74, 20);
            this.TxtTienPhiNT.Size = size;
            this.TxtTienPhiNT.TabIndex = 0x97;
            this.TxtTienPhiNT.Tag = null;
            this.TxtTienPhiNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTienPhiNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienPhiNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienPhiNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienPhi.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienPhi.DataType = typeof(double);
            this.TxtTienPhi.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x2d8, 0x54);
            this.TxtTienPhi.Location = point;
            this.TxtTienPhi.Name = "TxtTienPhi";
            padding = new Padding(1);
            this.TxtTienPhi.Padding = padding;
            this.TxtTienPhi.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtTienPhi.Size = size;
            this.TxtTienPhi.TabIndex = 150;
            this.TxtTienPhi.Tag = null;
            this.TxtTienPhi.TextAlign = HorizontalAlignment.Right;
            this.TxtTienPhi.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienPhi.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienPhi.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label2.AutoSize = true;
            point = new Point(430, 0x57);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x2f, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x95;
            this.Label2.Text = "Tiền ph\x00ed";
            point = new Point(0x5f, 0x54);
            this.TxtDienGiai.Location = point;
            this.TxtDienGiai.Name = "TxtDienGiai";
            size = new Size(0x146, 20);
            this.TxtDienGiai.Size = size;
            this.TxtDienGiai.TabIndex = 7;
            this.Label24.AutoSize = true;
            point = new Point(0x1af, 11);
            this.Label24.Location = point;
            this.Label24.Name = "Label24";
            size = new Size(0x29, 13);
            this.Label24.Size = size;
            this.Label24.TabIndex = 0x8a;
            this.Label24.Text = "TK. Nợ";
            this.Label25.AutoSize = true;
            point = new Point(0x1af, 0x24);
            this.Label25.Location = point;
            this.Label25.Name = "Label25";
            size = new Size(40, 13);
            this.Label25.Size = size;
            this.Label25.TabIndex = 0x88;
            this.Label25.Text = "TK. C\x00f3";
            this.CmdChuyen.Font = new Font("Arial", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
            point = new Point(0xfd, 0);
            this.CmdChuyen.Location = point;
            this.CmdChuyen.Name = "CmdChuyen";
            size = new Size(0x18, 0x17);
            this.CmdChuyen.Size = size;
            this.CmdChuyen.TabIndex = 14;
            this.CmdChuyen.Text = ">";
            this.CmdChuyen.UseVisualStyleBackColor = true;
            this.PNDungChung.Controls.Add(this.CmdChuyen);
            this.PNDungChung.Controls.Add(this.CboLoaiDuLieu);
            point = new Point(0x267, 0x16);
            this.PNDungChung.Location = point;
            this.PNDungChung.Name = "PNDungChung";
            size = new Size(280, 0x18);
            this.PNDungChung.Size = size;
            this.PNDungChung.TabIndex = 0x9e;
            this.PNDungChung.Visible = false;
            this.CboLoaiDuLieu.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiDuLieu.FormattingEnabled = true;
            point = new Point(90, 1);
            this.CboLoaiDuLieu.Location = point;
            this.CboLoaiDuLieu.Name = "CboLoaiDuLieu";
            size = new Size(0xa3, 0x15);
            this.CboLoaiDuLieu.Size = size;
            this.CboLoaiDuLieu.TabIndex = 13;
            this.Label26.AutoSize = true;
            point = new Point(11, 0x57);
            this.Label26.Location = point;
            this.Label26.Name = "Label26";
            size = new Size(0x30, 13);
            this.Label26.Size = size;
            this.Label26.TabIndex = 0x8b;
            this.Label26.Text = "Diễn giải";
            this.TabPage1.Controls.Add(this.Label1);
            this.TabPage1.Controls.Add(this.TxtTienPhiNT);
            this.TabPage1.Controls.Add(this.TxtTienPhi);
            this.TabPage1.Controls.Add(this.Label2);
            this.TabPage1.Controls.Add(this.Label26);
            this.TabPage1.Controls.Add(this.TxtDienGiai);
            this.TabPage1.Controls.Add(this.Label24);
            this.TabPage1.Controls.Add(this.Label25);
            this.TabPage1.Controls.Add(this.AdvTKNo);
            this.TabPage1.Controls.Add(this.AdvTKCo);
            this.TabPage1.Controls.Add(this.Label20);
            this.TabPage1.Controls.Add(this.AdvDoiTuong);
            this.TabPage1.Controls.Add(this.Label12);
            this.TabPage1.Controls.Add(this.TxtNgayChungTu);
            this.TabPage1.Controls.Add(this.Label19);
            this.TabPage1.Controls.Add(this.TxtSoChungTu);
            this.TabPage1.Controls.Add(this.CmdTimHoaDon);
            this.TabPage1.Controls.Add(this.CboLoaiTien);
            this.TabPage1.Controls.Add(this.TxtTyGia);
            this.TabPage1.Controls.Add(this.Label14);
            this.TabPage1.Controls.Add(this.Label15);
            this.TabPage1.Controls.Add(this.Label17);
            this.TabPage1.Controls.Add(this.TxtNgayHoaDon);
            this.TabPage1.Controls.Add(this.Label18);
            this.TabPage1.Controls.Add(this.TxtSoHoaDon);
            this.TabPage1.ImageIndex = 1;
            point = new Point(4, 0x1b);
            this.TabPage1.Location = point;
            this.TabPage1.Name = "TabPage1";
            padding = new Padding(3);
            this.TabPage1.Padding = padding;
            size = new Size(0x376, 0x70);
            this.TabPage1.Size = size;
            this.TabPage1.TabIndex = 0;
            this.TabPage1.Text = "Th\x00f4ng tin chứng từ chi ph\x00ed";
            this.TabPage1.UseVisualStyleBackColor = true;
            this.Label1.AutoSize = true;
            point = new Point(0x28c, 0x57);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x2c, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x98;
            this.Label1.Text = "Quy đổi";
            this.Label20.AutoEllipsis = true;
            this.Label20.AutoSize = true;
            point = new Point(0x1af, 0x3b);
            this.Label20.Location = point;
            this.Label20.Name = "Label20";
            this.Label20.RightToLeft = RightToLeft.No;
            size = new Size(0x35, 13);
            this.Label20.Size = size;
            this.Label20.TabIndex = 0x6a;
            this.Label20.Text = "Đối tượng";
            this.Label20.TextAlign = ContentAlignment.TopRight;
            this.Label12.AutoSize = true;
            point = new Point(240, 0x24);
            this.Label12.Location = point;
            this.Label12.Name = "Label12";
            size = new Size(0x20, 13);
            this.Label12.Size = size;
            this.Label12.TabIndex = 0x68;
            this.Label12.Text = "Ng\x00e0y";
            this.TxtNgayChungTu.Format = DateTimePickerFormat.Custom;
            point = new Point(330, 0x20);
            this.TxtNgayChungTu.Location = point;
            this.TxtNgayChungTu.Name = "TxtNgayChungTu";
            size = new Size(0x5b, 20);
            this.TxtNgayChungTu.Size = size;
            this.TxtNgayChungTu.TabIndex = 1;
            this.Label19.AutoSize = true;
            point = new Point(11, 0x24);
            this.Label19.Location = point;
            this.Label19.Name = "Label19";
            size = new Size(0x41, 13);
            this.Label19.Size = size;
            this.Label19.TabIndex = 0x66;
            this.Label19.Text = "Số chứng từ";
            point = new Point(0x5f, 0x21);
            this.TxtSoChungTu.Location = point;
            this.TxtSoChungTu.Name = "TxtSoChungTu";
            size = new Size(0x7c, 20);
            this.TxtSoChungTu.Size = size;
            this.TxtSoChungTu.TabIndex = 0;
            this.CmdTimHoaDon.FlatStyle = FlatStyle.System;
            point = new Point(0xc7, 8);
            this.CmdTimHoaDon.Location = point;
            padding = new Padding(0);
            this.CmdTimHoaDon.Margin = padding;
            this.CmdTimHoaDon.Name = "CmdTimHoaDon";
            size = new Size(0x16, 0x16);
            this.CmdTimHoaDon.Size = size;
            this.CmdTimHoaDon.TabIndex = 0x65;
            this.CmdTimHoaDon.Text = "...";
            this.CmdTimHoaDon.UseVisualStyleBackColor = true;
            this.CboLoaiTien.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiTien.FormattingEnabled = true;
            point = new Point(0x5f, 0x39);
            this.CboLoaiTien.Location = point;
            this.CboLoaiTien.Name = "CboLoaiTien";
            size = new Size(0x7d, 0x15);
            this.CboLoaiTien.Size = size;
            this.CboLoaiTien.TabIndex = 2;
            this.TxtTyGia.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTyGia.DataType = typeof(double);
            this.TxtTyGia.FormatType = FormatTypeEnum.Currency;
            point = new Point(330, 0x39);
            this.TxtTyGia.Location = point;
            this.TxtTyGia.Name = "TxtTyGia";
            padding = new Padding(1);
            this.TxtTyGia.Padding = padding;
            size = new Size(0x5b, 20);
            this.TxtTyGia.Size = size;
            this.TxtTyGia.TabIndex = 3;
            this.TxtTyGia.Tag = null;
            this.TxtTyGia.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.TxtTyGia.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTyGia.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label14.AutoSize = true;
            point = new Point(11, 0x3b);
            this.Label14.Location = point;
            this.Label14.Name = "Label14";
            size = new Size(0x2f, 13);
            this.Label14.Size = size;
            this.Label14.TabIndex = 14;
            this.Label14.Text = "Loại tiền";
            this.Label14.TextAlign = ContentAlignment.TopRight;
            this.Label15.AutoSize = true;
            point = new Point(0xef, 0x3d);
            this.Label15.Location = point;
            this.Label15.Name = "Label15";
            size = new Size(0x24, 13);
            this.Label15.Size = size;
            this.Label15.TabIndex = 0x10;
            this.Label15.Text = "Tỷ gi\x00e1";
            this.Label15.TextAlign = ContentAlignment.TopRight;
            this.Label17.AutoSize = true;
            point = new Point(240, 12);
            this.Label17.Location = point;
            this.Label17.Name = "Label17";
            size = new Size(0x20, 13);
            this.Label17.Size = size;
            this.Label17.TabIndex = 12;
            this.Label17.Text = "Ng\x00e0y";
            this.TxtNgayHoaDon.Enabled = false;
            this.TxtNgayHoaDon.Format = DateTimePickerFormat.Custom;
            point = new Point(330, 8);
            this.TxtNgayHoaDon.Location = point;
            this.TxtNgayHoaDon.Name = "TxtNgayHoaDon";
            size = new Size(0x5b, 20);
            this.TxtNgayHoaDon.Size = size;
            this.TxtNgayHoaDon.TabIndex = 13;
            this.Label18.AutoSize = true;
            point = new Point(11, 12);
            this.Label18.Location = point;
            this.Label18.Name = "Label18";
            size = new Size(0x3f, 13);
            this.Label18.Size = size;
            this.Label18.TabIndex = 10;
            this.Label18.Text = "Số h\x00f3a đơn";
            point = new Point(0x5f, 9);
            this.TxtSoHoaDon.Location = point;
            this.TxtSoHoaDon.Name = "TxtSoHoaDon";
            this.TxtSoHoaDon.ReadOnly = true;
            size = new Size(0x67, 20);
            this.TxtSoHoaDon.Size = size;
            this.TxtSoHoaDon.TabIndex = 11;
            this.TabPage2.Controls.Add(this.VSHangHoa);
            point = new Point(4, 0x1b);
            this.TabPage2.Location = point;
            this.TabPage2.Name = "TabPage2";
            padding = new Padding(3);
            this.TabPage2.Padding = padding;
            size = new Size(0x376, 0x15f);
            this.TabPage2.Size = size;
            this.TabPage2.TabIndex = 0;
            this.TabPage2.Text = "Chi tiết h\x00e0ng h\x00f3a";
            this.TabPage2.UseVisualStyleBackColor = true;
            this.VSHangHoa.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSHangHoa.ColumnInfo = manager.GetString("VSHangHoa.ColumnInfo");
            this.VSHangHoa.Dock = DockStyle.Fill;
            this.VSHangHoa.ExtendLastCol = true;
            this.VSHangHoa.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(3, 3);
            this.VSHangHoa.Location = point;
            padding = new Padding(0);
            this.VSHangHoa.Margin = padding;
            this.VSHangHoa.Name = "VSHangHoa";
            this.VSHangHoa.Rows.Count = 1;
            this.VSHangHoa.Rows.DefaultSize = 0x11;
            this.VSHangHoa.Rows.MinSize = 20;
            size = new Size(880, 0x159);
            this.VSHangHoa.Size = size;
            this.VSHangHoa.StyleInfo = manager.GetString("VSHangHoa.StyleInfo");
            this.VSHangHoa.TabIndex = 8;
            this.VSHangHoa.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            this.ImageList1.ImageStream = (ImageListStreamer) manager.GetObject("ImageList1.ImageStream");
            this.ImageList1.TransparentColor = Color.Transparent;
            this.ImageList1.Images.SetKeyName(0, "orders_main.png");
            this.ImageList1.Images.SetKeyName(1, "checkingacct.png");
            this.ImageList1.Images.SetKeyName(2, "billing.png");
            this.TabControl1.Controls.Add(this.TabPage1);
            this.TabControl1.Dock = DockStyle.Top;
            this.TabControl1.ImageList = this.ImageList1;
            point = new Point(0, 0x19);
            this.TabControl1.Location = point;
            this.TabControl1.Name = "TabControl1";
            this.TabControl1.SelectedIndex = 0;
            size = new Size(0x37e, 0x8f);
            this.TabControl1.Size = size;
            this.TabControl1.TabIndex = 0x9c;
            this.TabControl2.Controls.Add(this.TabPage2);
            this.TabControl2.Dock = DockStyle.Fill;
            this.TabControl2.ImageList = this.ImageList1;
            point = new Point(0, 0xa8);
            this.TabControl2.Location = point;
            this.TabControl2.Name = "TabControl2";
            this.TabControl2.SelectedIndex = 0;
            size = new Size(0x37e, 0x17e);
            this.TabControl2.Size = size;
            this.TabControl2.TabIndex = 0x9b;
            this.AdvTKNo.Conditions = "";
            this.AdvTKNo.DefaultValue = "";
            this.AdvTKNo.FieldNameFilter = "";
            this.AdvTKNo.KeyFilter = "";
            point = new Point(0x202, 9);
            this.AdvTKNo.Location = point;
            padding = new Padding(0);
            this.AdvTKNo.Margin = padding;
            this.AdvTKNo.Name = "AdvTKNo";
            this.AdvTKNo.OnlyDigit = false;
            this.AdvTKNo.ReadOnly = false;
            size = new Size(0x13f, 20);
            this.AdvTKNo.Size = size;
            this.AdvTKNo.TabIndex = 5;
            this.AdvTKNo.UpperText = true;
            this.AdvTKNo.Value = "";
            this.AdvTKNo.WithCode = 80;
            this.AdvTKCo.Conditions = "";
            this.AdvTKCo.DefaultValue = "";
            this.AdvTKCo.FieldNameFilter = "";
            this.AdvTKCo.KeyFilter = "";
            point = new Point(0x202, 0x21);
            this.AdvTKCo.Location = point;
            padding = new Padding(0);
            this.AdvTKCo.Margin = padding;
            this.AdvTKCo.Name = "AdvTKCo";
            this.AdvTKCo.OnlyDigit = false;
            this.AdvTKCo.ReadOnly = false;
            size = new Size(0x13f, 20);
            this.AdvTKCo.Size = size;
            this.AdvTKCo.TabIndex = 6;
            this.AdvTKCo.UpperText = true;
            this.AdvTKCo.Value = "";
            this.AdvTKCo.WithCode = 80;
            this.AdvDoiTuong.Conditions = "";
            this.AdvDoiTuong.LoaiDoiTuong = modGeneral.TypeObjects.TatCa;
            point = new Point(0x202, 0x38);
            this.AdvDoiTuong.Location = point;
            this.AdvDoiTuong.Name = "AdvDoiTuong";
            this.AdvDoiTuong.ReadOnly = false;
            size = new Size(0x13f, 20);
            this.AdvDoiTuong.Size = size;
            this.AdvDoiTuong.TabIndex = 4;
            this.AdvDoiTuong.UpperText = true;
            this.AdvDoiTuong.Value = "";
            this.AdvDoiTuong.WidthCode = 80;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x37e, 0x23f);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.TabControl2);
            this.Controls.Add(this.Panel1);
            this.Controls.Add(this.PNDungChung);
            this.Controls.Add(this.TabControl1);
            this.Controls.Add(this.ToolStrip1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.HelpButton = true;
            this.Name = "Frm_TinhChiPhiBanHang";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "TINH CHI PHI BAN HANG";
            this.ToolStrip1.ResumeLayout(false);
            this.ToolStrip1.PerformLayout();
            ((ISupportInitialize) this.TxtTienPhiNT).EndInit();
            ((ISupportInitialize) this.TxtTienPhi).EndInit();
            this.PNDungChung.ResumeLayout(false);
            this.TabPage1.ResumeLayout(false);
            this.TabPage1.PerformLayout();
            ((ISupportInitialize) this.TxtTyGia).EndInit();
            this.TabPage2.ResumeLayout(false);
            this.VSHangHoa.EndInit();
            this.TabControl1.ResumeLayout(false);
            this.TabControl2.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public void InsertHoaDon(string strKhoaHoaDon)
        {
            if (!this.mEnabledControl)
            {
                this.CmdAdd_Click(this.CmdAdd, null);
            }
            this.cFrmKhoaHoaDon = strKhoaHoaDon;
            this.ShowDataPhieuXuat(this.cFrmKhoaHoaDon);
        }

        public void PhanBoPhi()
        {
            double num4 = 0.0;
            double pTongSo = 0.0;
            double num3 = 0.0;
            double num5 = 0.0;
            double num8 = 0.0;
            double num9 = 0.0;
            clsDMLoaiTien tien = new clsDMLoaiTien();
            num4 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienPhiNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            num5 = num4;
            num8 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            tien.LoadByCode(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim());
            int soLe = tien.SoLe;
            if (num4 != 0.0)
            {
                pTongSo = LVYModule.SumColGrid(this.VSHangHoa, 15);
                if (pTongSo != 0.0)
                {
                    int num10 = this.VSHangHoa.Rows.Count - 1;
                    for (int i = 1; i <= num10; i++)
                    {
                        if (i < (this.VSHangHoa.Rows.Count - 1))
                        {
                            num9 = this.PhanTram(pTongSo, Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 15]), 0, modGeneral.TypeOfValue.Nothing)));
                            num3 = Math.Round((double) ((num4 * num9) / 100.0), soLe);
                            this.VSHangHoa[i, 0x12] = num3;
                            num5 -= num3;
                        }
                        else
                        {
                            this.VSHangHoa[i, 0x12] = num5;
                        }
                    }
                }
            }
        }

        public double PhanTram(double pTongSo, double pSo)
        {
            return ((pSo * 100.0) / pTongSo);
        }

        public void ShowData(string strKhoa)
        {
            this.objCP.Load(strKhoa);
            this.TxtSoChungTu.Text = this.objCP.SoChungTu;
            this.TxtNgayChungTu.Text = LVYModule.Char2Date(this.objCP.NgayChungTu);
            this.TxtDienGiai.Text = this.objCP.DienGiai;
            this.TxtTienPhiNT.Value = this.objCP.TienPhiNT;
            this.TxtTienPhi.Value = this.objCP.TienPhi;
            this.CboLoaiTien.SelectedValue = this.objCP.LoaiTien;
            this.TxtTyGia.Value = this.objCP.TyGia;
            this.AdvDoiTuong.Value = this.objCP.KhoaDoiTuong;
            this.AdvTKNo.Value = this.objCP.KhoaTaiKhoanNo;
            this.AdvTKCo.Value = this.objCP.KhoaTaiKhoanCo;
            this.objHD.Load(this.objCP.KhoaPhieuXuat);
            this.cFrmKhoaHoaDon = this.objHD.Khoa;
            this.TxtSoHoaDon.Text = this.objHD.SoChungTu;
            this.TxtNgayHoaDon.Text = LVYModule.Char2Date(this.objHD.NgayChungTu);
            this.CboLoaiDuLieu.SelectedValue = this.objCP.DuLieu;
            DataTable details = this.objCP.GetDetails(strKhoa);
            this.VSHangHoa.Rows.Count = 1;
            int num2 = details.Rows.Count - 1;
            for (int i = 0; i <= num2; i++)
            {
                C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                vSHangHoa.AddItem("");
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(details.Rows[i]["Khoa"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaKho"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoHang"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaHangHoa"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(details.Rows[i]["Ma"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(details.Rows[i]["HangHoa"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(details.Rows[i]["SoLoHang"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(details.Rows[i]["SoSeri"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(details.Rows[i]["NgayNhap"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(details.Rows[i]["HanSuDung"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaDonViTinh"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(details.Rows[i]["DonViTinh"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(details.Rows[i]["QuyCach"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(details.Rows[i]["SoLuong"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(details.Rows[i]["GiaBanNT"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TienBanNT"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0x10] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TyLeThue"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TienThue"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0x12] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TienHoaHongNT"]);
                vSHangHoa = null;
            }
        }

        public void ShowDataPhieuXuat(string strKhoaHoaDon)
        {
            this.objHD.Load(strKhoaHoaDon);
            this.TxtSoHoaDon.Text = this.objHD.SoChungTu;
            this.TxtNgayHoaDon.Text = LVYModule.Char2Date(this.objHD.NgayChungTu);
            this.CboLoaiTien.SelectedValue = this.objHD.LoaiTien;
            this.TxtTyGia.Value = this.objHD.TyGia;
            this.AdvDoiTuong.Value = this.objHD.KhoaDoiTuong;
            this.TxtDienGiai.Text = modGeneral.Tranlated("T\x00ednh hoa hồng h\x00f3a đơn số", "") + ": " + this.objHD.SoChungTu;
            this.VSHangHoa.Rows.Count = 1;
            DataTable listDetails = this.objHD.GetListDetails(strKhoaHoaDon);
            int num2 = listDetails.Rows.Count - 1;
            for (int i = 0; i <= num2; i++)
            {
                C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                vSHangHoa.AddItem("");
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["Khoa"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaKho"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoHang"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaHangHoa"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["Ma"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["HangHoa"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoLoHang"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoSeri"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["NgayNhap"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["HanSuDung"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaDonViTinh"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["DonViTinh"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["QuyCach"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoLuong"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["GiaBanNT"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienBanNT"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0x10] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TyLeThue"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienThueNT"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0x12] = 0;
                vSHangHoa = null;
            }
        }

        private void TxtTienPhiNT_ValueChanged(object sender, EventArgs e)
        {
            this.TxtTienPhi.Value = Conversion.Val(RuntimeHelpers.GetObjectValue(this.TxtTienPhiNT.Value)) * Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
            this.PhanBoPhi();
        }

        internal virtual ADVObjects AdvDoiTuong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvDoiTuong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvDoiTuong = value;
            }
        }

        internal virtual ADVAccount AdvTKCo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTKCo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTKCo = value;
            }
        }

        internal virtual ADVAccount AdvTKNo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTKNo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTKNo = value;
            }
        }

        internal virtual ComboBox CboLoaiDuLieu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiDuLieu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLoaiDuLieu = value;
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLoaiTien = value;
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual Button CmdChuyen
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdChuyen;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdChuyen = value;
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdDel = value;
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdEdit = value;
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdFind
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdFind;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdFind = value;
            }
        }

        internal virtual ToolStripButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdPrint = value;
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdSave = value;
            }
        }

        internal virtual Button CmdTimHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdTimHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdTimHoaDon_Click);
                if (this._CmdTimHoaDon != null)
                {
                    this._CmdTimHoaDon.Click -= handler;
                }
                this._CmdTimHoaDon = value;
                if (this._CmdTimHoaDon != null)
                {
                    this._CmdTimHoaDon.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        public bool EnabledControl
        {
            get
            {
                return this.mEnabledControl;
            }
            set
            {
                this.mEnabledControl = value;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.CmdFind.Enabled = !value;
                this.CmdExit.Enabled = !value;
                this.CmdPrint.Enabled = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.TxtNgayChungTu.Enabled = value;
                this.CboLoaiTien.Enabled = value;
                this.AdvTKCo.ReadOnly = !value;
                this.AdvTKNo.ReadOnly = !value;
                this.AdvDoiTuong.ReadOnly = !value;
                this.TxtDienGiai.ReadOnly = !value;
                this.TxtTyGia.ReadOnly = !value;
                this.CboLoaiDuLieu.Enabled = value;
                this.CmdChuyen.Enabled = !value;
                this.CmdTimHoaDon.Enabled = value;
            }
        }

        internal virtual ImageList ImageList1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ImageList1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ImageList1 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label12
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label12;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label12 = value;
            }
        }

        internal virtual Label Label14
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label14;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label14 = value;
            }
        }

        internal virtual Label Label15
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label15;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label15 = value;
            }
        }

        internal virtual Label Label17
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label17;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label17 = value;
            }
        }

        internal virtual Label Label18
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label18;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label18 = value;
            }
        }

        internal virtual Label Label19
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label19;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label19 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label20
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label20;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label20 = value;
            }
        }

        internal virtual Label Label24
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label24;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label24 = value;
            }
        }

        internal virtual Label Label25
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label25;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label25 = value;
            }
        }

        internal virtual Label Label26
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label26;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label26 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel PNDungChung
        {
            [DebuggerNonUserCode]
            get
            {
                return this._PNDungChung;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._PNDungChung = value;
            }
        }

        internal virtual TabControl TabControl1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabControl1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabControl1 = value;
            }
        }

        internal virtual TabControl TabControl2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabControl2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabControl2 = value;
            }
        }

        internal virtual TabPage TabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage1 = value;
            }
        }

        internal virtual TabPage TabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage2 = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripButton ToolStripButton2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual TextBox TxtDienGiai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienGiai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDienGiai = value;
            }
        }

        internal virtual DateTimePicker TxtNgayChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayChungTu = value;
            }
        }

        internal virtual DateTimePicker TxtNgayHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayHoaDon = value;
            }
        }

        internal virtual TextBox TxtSoChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoChungTu = value;
            }
        }

        internal virtual TextBox TxtSoHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoHoaDon = value;
            }
        }

        internal virtual C1NumericEdit TxtTienPhi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienPhi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienPhi = value;
            }
        }

        internal virtual C1NumericEdit TxtTienPhiNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienPhiNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTienPhiNT_ValueChanged);
                if (this._TxtTienPhiNT != null)
                {
                    this._TxtTienPhiNT.ValueChanged -= handler;
                }
                this._TxtTienPhiNT = value;
                if (this._TxtTienPhiNT != null)
                {
                    this._TxtTienPhiNT.ValueChanged += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtTyGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTyGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTyGia = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSHangHoa
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSHangHoa;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSHangHoa = value;
            }
        }
    }
}

